<%@ page contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<script type="text/javascript">
function deleteCheck(no,currentPage){
	if(confirm(no + " 번 글을 삭제하시겠습니까?")){
		alert('삭제되었습니다.');
		location.href="adminReviewDeleteAction.action?no="+ no +"&currentPage="+ currentPage;
	}; 
}
</script>
<h2 class="page_title"><strong>만남후기 게시판</strong></h2>
<s:if test="#session.session_id==null">
	<p><strong>로그인</strong>을 하셔야 게시물을 열람하실 수 있습니다. </p>
</s:if>
<s:else>
	<div>
		<!-- 검색부분 -->
		<form class="align_r">
			<select name="searchNum">
				<option value="0">작성자</option>
				<option value="1">제목</option>
				<option value="2">내용</option>
			</select>
			<s:textfield name="searchKeyword" theme="simple" value=""
				cssStyle="width:120px" maxlength="20" />
			<input name="submit" type="submit" value="검색" class="inputb">
		</form>
		<!-- 말머리 검색 -->
		<form>
			<select name="searchWhole">
				<option value="7">전체</option>
				<option value="4">자유</option>
				<option value="5">질문</option>
				<option value="6">건의</option>
			</select> <input type="submit" value="검색" class="whole">
		</form>
	</div>
</s:else>
<table class="table_list">
	<colgroup>
		<col width="90px" />
		<col width="90px" />
		<col />
		<col width="120px" />
		<col width="120px" />
		<col width="120px" />
		<col width="120px" />
	</colgroup>
	<tr>
		<th>번호</th>
		<th>말머리</th>
		<th>제목</th>
		<th>닉네임</th>
		<th>날짜</th>
		<th>조회</th>
		<th>DELETE</th>
	</tr>

	<s:iterator value="list" status="stat">
		<s:url id="viewURL" action="adminReViewAction">
			<s:param name="no">
				<s:property value="no" />
			</s:param>
			<s:param name="currentPage">
				<s:property value="currentPage" />
			</s:param>
		</s:url>
		<tr>
			<td><s:property value="no" /></td>
			<td><s:property value="whole" /></td>
			<s:if test="#session.session_id==null">
				<td class="align_l">&nbsp;
					<s:property value="subject" />
				</td>
			</s:if>
			<s:else>
				<td class="align_l">&nbsp;
					<s:a href="%{viewURL}"><s:property value="subject" /></s:a>
				</td>
			</s:else>
			
			<td><s:property value="nickname" /></td>
			<td><s:property value="regdate" /></td>
			<td><s:property value="readhit" /></td>
			<td><a href="javascript:deleteCheck('<s:property value="no"/>','<s:property value="currentPage" />');"><font color="red"><strong>삭제</strong></font></a></td>
		</tr>
	</s:iterator>
	<s:if test="list.size() <= 0">
		<tr>
			<td colspan="7" class="align_c" height="40px">등록된 게시물이 없습니다</td>
		</tr>
	</s:if>
</table>
<p class="align_c">
	<s:property value="pagingHtml" escape="false" />
</p>
<s:if test="#session.session_id!=null">
<p class="align_r">
	<input name="list" type="button" value="프론트페이지 만남후기 게시판으로 가기" class="inputb" onClick="javascript:location.href='reviewListAction.action?currentPage=<s:property value="currentPage" />'">
</p>
</s:if>

